import React, { useState } from "react";
import { useRoutes } from "react-router-dom";

import { ContextProvider, useAppContext } from "./services/context"
import { defaultRoutes } from "./services/routes"

function App() {
  const [route, setRoute] = useState(defaultRoutes)
  const elements = useRoutes(route)
  const {context, setContext}=useAppContext()
  
  return (
    <ContextProvider>
      {elements}
    </ContextProvider>
  );
}

export default App;
